#pragma once

#include "Object.h"
#include "View.h"

class Container : public Object
{
public:
	Container(View* pView, HWND hWnd);
	virtual ~Container(void);
	
public:
	void ViewMove(const POINT *lpSrc, const POINT *lpDst);
	void ViewResize(const SIZE *lpSrc, const SIZE *lpDst);
	void Timer(void *id);
	void MouseMove(const POINT *lpPoint);
	void MouseLeftDown(const POINT *lpPoint);
	void MouseLeftUp(const POINT *lpPoint);
	void MouseLeave();
	void Render(HDC hdc, const RECT *lpRect);

	static void SetTimer(void * id, int delay);
	static void KillTimer(void * id);

protected:
	void DoClick(const POINT* pt);
	void DoMouseEnter();
	void DoMouseLeave();
	
	void OnInvalidateRect(const RECT *lpRect);

private:
	TXCComPtr<View> m_pView;
	TXCComPtr<View> m_pMouseEnter, m_pMouseDown;
	static HWND m_hWnd;
	BOOL m_bTrackingMouse;
};